package org.jeecg.modules.demo.com.kunpeng.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.demo.com.kunpeng.entity.SaleContractDetail;
import org.jeecg.modules.demo.com.kunpeng.entity.dto.SaleContractKeyWordsQueryDTO;
import org.jeecg.modules.demo.com.kunpeng.entity.SaleContract;
import org.jeecg.modules.demo.com.kunpeng.entity.CustomerInformation;
import org.jeecg.modules.demo.com.kunpeng.entity.SaleContractCollectionPlan;
import org.jeecg.modules.demo.com.kunpeng.vo.SaleContractVO;


import java.io.Serializable;
import java.util.Collection;
import java.util.List;

/**
 * @Description: 销售合同表
 * @Author: jeecg-boot
 * @Date:   2022-12-03
 * @Version: V1.0
 */
public interface ISaleContractService extends IService<SaleContract> {

	/**
	 * 添加一对多
	 *
	 * @param saleContract
	 * @param saleContractCollectionPlanList
	 * @param saleContractDetailList
	 */
	public void saveMain(SaleContract saleContract, List<SaleContractCollectionPlan> saleContractCollectionPlanList, List<SaleContractDetail> saleContractDetailList,CustomerInformation customerInformation) ;
	
	/**
	 * 修改一对多
	 *
   * @param saleContract
   * @param saleContractCollectionPlanList
   * @param saleContractDetailList
	 */
	public void updateMain(SaleContract saleContract, List<SaleContractCollectionPlan> saleContractCollectionPlanList, List<SaleContractDetail> saleContractDetailList);

	/**
	 * 删除一对多
	 *
	 * @param id
	 */
	public void delMain(String id);

	/**
	 * 批量删除一对多
	 *
	 * @param idList
	 */
	public void delBatchMain(Collection<? extends Serializable> idList);

	/**
	 * 根据关键字分页查询
	 * @param page
	 * @param saleContractKeyWordsQueryDTO
	 * @return
	 */
	Page<SaleContractVO> listByKeyWords(Page<SaleContractVO> page, SaleContractKeyWordsQueryDTO saleContractKeyWordsQueryDTO);


	/**
	 * 根据项目名称获取销售项目数据
	 */
	SaleContractVO selectByProjectName(String projectName);

	/**
	 * 根据销售合同编号获取销售合同数据列表
	 * @param saleContractId
	 * @return
	 */
	List<SaleContractVO> selectBySaleContractId(String saleContractId);

	/**
	 * 根据id修改销售合同关联项目名称
	 * @param id
	 */
	void updateProjectNameById(String id,String projectName);

	/**
	 * 根据id修改状态
	 * @param id
	 * @param status
	 */
	void updateStateById(String id,String status);
}
